<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/10/13
 * Time: 16:20
 */

namespace app\admin\validate;

class IDMustBePostvieInt extends BaseValidate {
    protected $rule = [
        'id'=> 'require|IDMustBePostvieInt',
    ];

    protected $message = [
        "id" => 'id必须是正整数',
    ];

    /**
     * 检查id是否是正整数
     * @param $values
     * @return bool
     */
    public function fieldMustBeInt($values){
        foreach ($values as $k => $v){
            if(!$this->IDMustBeInt($v)){
                return false;
            }
        }
        return true;
    }
}